/*
 * @Author: SatanYoung amgyjl0926@163.com
 * @Date: 2022-12-19 16:38:26
 * @LastEditors: SatanYoung amgyjl0926@163.com
 * @LastEditTime: 2022-12-20 14:21:19
 * @FilePath: \aaaaa\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
window.onload = function () {
    var dropBtn = document.getElementById('drop-btn')
    var dropUl = document.getElementById('drop-ul')
    let showLi = function () {
        if (dropUl.style.display === 'block') {
            dropUl.style.display = 'none'
        }
        else {
            dropUl.style.display = 'block'
        }
    }
    dropBtn.addEventListener('click', showLi)
    for (let i = 0; i < dropUl.children.length; i++) {
        dropUl.children[i].addEventListener('click', function () {
            dropBtn.innerText = dropUl.children[i].innerText
            dropUl.style.display = 'none'
        })
    }
    console.log(dropBtn.innerHTML);
}